package #(table.packageName).domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.sql.Types;

import lombok.Data;
import org.noear.solon.validation.annotation.*;
import org.sagacity.sqltoy.config.annotation.Entity;
import org.sagacity.sqltoy.config.annotation.Id;
import org.sagacity.sqltoy.config.annotation.Column;
#if(option.isGenExport())
import com.palm.core.anno.Excel;
#end

/**
* #(table.title)
*/
@Data
@Entity(tableName="#(table.code)")
public class #(table.name) implements Serializable{
    #for(column:table.columns)
    /**
    * #(column.name)
    */
    #if(column.isPrimaryKey())
    @Id
    #else if(column.isMandatory())
    @NotNull
    #end
    #if(column.dataType=='String')
    @Length(max=#(column.length))
    #end
    #if(option.isGenExport())
    #if(column.dict||column.translate)
    #if(!option.isGenFormVo())
    @Excel("#(column.name)");
    #end
    #else
    @Excel("#(column.name)")
    #end
    #end
    @Column(name="#(column.code)",length=#(column.length)L,type=Types.#(column.type)#if(column.isMandatory()),nullable=false#end)
    private #(column.dataType) #(column.field);
    #end
}
